from api05 import *
import pprint

login,cookies=login('auto','sdfsdfsdf')
print('登陆成功')

sessionid =cookies['sessionid']

#删除前先列出课程
coursebefor=list_course(sessionid)

delect=delete_course(1083,sessionid)

if delect['retcode']==0:
    print('删除课程成功')
else:
    print('删除课程失败')

#删除后再列出课程
courseafter=list_course(sessionid)

# assert coursebefor['name']=='python'
# assert coursebefor['id']=='1082'

if len(coursebefor) - len(courseafter) ==1:
    print('删除一门课程成功')

print('\n---------test case-----------')
